from utils.SendMethod import SendMethod


class Event:
    def __init__(self):
        self.url = "http://127.0.0.1:8000"

    # 添加发布会
    def add_event(self, body):
        method = "post"
        url = self.url + "/api/add_event/"
        return SendMethod.send_method(method, url, body=body)

    # 查询发布会
    def search_event(self, params):
        method = "get"
        url = self.url + "/api/get_event_list/"
        return SendMethod.send_method(method, url, params=params)


if __name__ == '__main__':
    payload = {
        "eid": "1888",
        "name": "魅族发布会222",
        "limit": "20",
        "status": "1",
        "address": "武汉源码时代",
        "start_time": "2022-07-21"
    }
    params = {
        "eid": "1888",
        "name": "魅族发布会222"
    }
    body_guest = {
        "eid": "1999",
        "realname": "sun",
        "phone": "13000000000",
        "email": "xxx@163.com.cn"
    }
    params_guest = {
        "eid": "555",
        "phone": "13100000000"
    }
    # 添加发布会
    # print(Event().add_event(payload))
    # 查询发布会
    # print(Event().get_event(params))